Skip to content

OCLOMRS-1122: Decode any HTML-encoding of the key#124

Merged
ibacher merged 1 commit intomasterfrom
OCLOMRS-1122
Apr 2, 2026
Merged

OCLOMRS-1122: Decode any HTML-encoding of the key#124
ibacher merged 1 commit intomasterfrom
OCLOMRS-1122

Conversation

@ibacher
Copy link
Copy Markdown
Member

@ibacher ibacher commented Apr 2, 2026

Recently, it's been reported that some users are experiencing issues with the OCL subscription workflow that result in getting a 401 response even when everything looks correct. I suspect the issue relates to some of the XSS work we did last year, so this undoes that. I have not, however, done any rigorous attempt to prove that is the issue. In either case, this is pretty harmless.

@ibacher ibacher marked this pull request as ready for review April 2, 2026 21:22
@ibacher ibacher requested a review from Copilot April 2, 2026 21:52
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts OCL subscription retrieval to tolerate HTML-entity encoded global property values (likely introduced by prior XSS-hardening), preventing invalid token/URL values from being used in the subscription workflow.

Changes:

  • Unescapes HTML4 entities when reading the subscription URL and token from global properties.
  • Adds a regression test validating HTML entity unescaping for both URL and token.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
api/src/main/java/org/openmrs/module/openconceptlab/ImportServiceImpl.java Unescapes HTML entities for subscription URL/token when building the Subscription.
api/src/test/java/org/openmrs/module/openconceptlab/ImportServiceTest.java Adds test coverage ensuring HTML-escaped URL/token global properties are correctly unescaped.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ibacher ibacher merged commit 6912486 into master Apr 2, 2026
12 checks passed
@ibacher ibacher deleted the OCLOMRS-1122 branch April 2, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants